Skip to content

Secures content-app headers consistently. - #8036

Open
ggainey wants to merge 1 commit into
pulp:mainfrom
ggainey:headers
Open

Secures content-app headers consistently.#8036
ggainey wants to merge 1 commit into
pulp:mainfrom
ggainey:headers

Conversation

@ggainey

@ggainey ggainey commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Addresses CVE-2026-84232.

Comment on lines +1 to +4
Insures that `Content-Disposition`, `Content-Security-Policy`, and `X-Content-Type-Options`
are set consistently in the content-app.

This addresses CVE-2026-84232.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this all on one line. Multi-line changelogs break our rendering, e.g. https://pulpproject.org/pulpcore/changes/#3.115.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have the same issue still on stream_remote_artiifact? This fix is only for content that is immediately synced/uploaded.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, let me dig - the initial report was only for uploaded-content.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gerrod3 My goal with this would be to "guarantee" this set of headers as early in the response-process as possible, and preferably Just Once (ie before we make the stream-vs-return decision). We need either the Response, or the/a list of headers we're planning to add to a Response, and Content-Disposition needs/wants the "filename". Do you have any thoughts on the best place to do this setup?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. _match_and_stream typically calls two methods to generate the response _serve_content_artifact(ca, headers, request) or _stream_content_artifact(request, StreamResponse(headers=headers), ca). In both cases we get the original headers dict from the handler's response_headers(original_rel_path, distro), but when we call this method we don't know the final ContentArtifact that is going to be used (if we are serving a CA at all) for the request. Both of the serving methods update the headers dict with extra things they set before returning the final response, so maybe the best we can do is create a small helper and have both methods call it to update the dict.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hugely helpful, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants